package com.cqgcxy.shopping.service;

import com.cqgcxy.shopping.common.CommException;
import com.cqgcxy.shopping.controller.AdminLoginServlet;
import com.cqgcxy.shopping.dao.Administratordao;
import com.cqgcxy.shopping.domain.Administrator;;

public class AdminService {
	Administratordao AdminstratorDao=new Administratordao();
	public boolean login(String admincode,String adminpassword) {
		//TODO 登录逻辑
		Administrator administrator=Administratordao.findByCode(admincode,adminpassword);
		if(administrator==null) {
			throw new CommException("找不到指定账号！");
		}
		if (!administrator.getAdminpassword().equals(adminpassword)) {
			throw new CommException("密码输入错误!");
		}
		return false;
	}
	
	
	
	
	
	
	
	
	
}
